package com.daiyang.lottery.common.util;

import cn.hutool.captcha.LineCaptcha;
import cn.hutool.captcha.generator.RandomGenerator;

public class CapchaUtil {
    /**
     * 生成验证码
     */

    public static String generateCaptchaCode(int length) {
        RandomGenerator randomGenerator =
                new RandomGenerator("0123456789", length);
        LineCaptcha lineCaptcha=new LineCaptcha(200,100);
        lineCaptcha.createCode();
        String code=lineCaptcha.getCode();
        return code;
    }
}
